﻿package com.gengine.core
{
    import flash.utils.*;

    public class FrameUtil extends Object
    {
        public static var isOpen:Boolean = true;
        private static var _frameStartTime:int;
        public static const FrameMaxInterval:int = 12;
        public static var frameProTimer:int;
        public static var timerProTimer:int;
        public static var messageProTimer:int;
        public static var sortProTimer:int;
        private static var _driveInfo:String = "";
        public static var isDriverOpenGL:Boolean = true;
        public static var isDriverUserDisabled:Boolean = false;
        public static var isDriverUnavailable:Boolean = false;
        public static var isDriverSoftRender:Boolean;
        private static var _flag:Boolean = true;
        private static var _passtimes:int;

        public function FrameUtil()
        {
            return;
        }// end function

        public static function get driveInfo() : String
        {
            return _driveInfo;
        }// end function

        public static function set driveInfo(param1:String) : void
        {
            _driveInfo = param1;
            isDriverOpenGL = _driveInfo.indexOf("OpenGL") != -1;
            isDriverUserDisabled = _driveInfo.indexOf("userDisabled") != -1;
            isDriverUnavailable = _driveInfo.indexOf("unavailable") != -1;
            isDriverSoftRender = isDriverUnavailable || isDriverUserDisabled;
            return;
        }// end function

        public static function set frameStartTime(param1:int) : void
        {
            _frameStartTime = param1;
            _flag = true;
            return;
        }// end function

        public static function canOperate() : Boolean
        {
            if (!isOpen)
            {
                return true;
            }
            if (_flag == false)
            {
                return false;
            }
            _flag = getTimer() - _frameStartTime < FrameMaxInterval;
            return _flag;
        }// end function

    }
}
